package com.yu.crm.domain.pojo;

import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.time.LocalDateTime;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户登录流水表
 * </p>
 *
 * @author donnie-bin
 * @since 2019-07-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@JSONType(orders = {"id"})
@ApiModel(value="CrmLogin对象", description="用户登录流水表")
public class CrmLogin implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键", required = false)
    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;

    @ApiModelProperty(value = "登录名称，账号/手机号/OpenID", required = true)
    @NotEmpty(message = "登录名称，账号/手机号/OpenID不能为空")
    @TableField("login_name")
    private String loginName;

    @ApiModelProperty(value = "登录方式，1：账户密码登录，2：手机号登录，3：微信登录", required = true)
    @NotNull(message = "登录方式，1：账户密码登录，2：手机号登录，3：微信登录不能为空")
    @TableField("login_type")
    private Integer loginType;

    /**
     * 用户token
     */
    @TableField("user_token")
    private String userToken;

    @ApiModelProperty(value = "附加验证码", required = false)
    @TableField("login_extra_code")
    private String loginExtraCode;

    @ApiModelProperty(value = "用户ID", required = false)
    @TableField("login_user_id")
    private String loginUserId;

    @ApiModelProperty(value = "创建时间", required = false)
    @TableField("gmt_create")
    private LocalDateTime gmtCreate;

    @ApiModelProperty(value = "修改时间", required = false)
    @TableField("gmt_modified")
    private LocalDateTime gmtModified;

    @ApiModelProperty(value = "登录用户ID", required = false)
    @TableField("is_deleted")
    @TableLogic
    private Integer isDeleted;


    @ApiModelProperty(value = "登录 密码/短信验证码/*", required = true)
    @NotEmpty(message = "登录 密码/短信验证码/*不能为空")
    @TableField(exist = false)
    private String loginPassword;

    @ApiModelProperty(value = "验证码ID", required = false)
    @TableField(exist = false)
    private String verifyCodeId;
}
